namespace map2D {
	export class ANode implements IPoolObject{
		public pid:number;
		public id:number;
		public pos:number[];
		public G:number;
		public H:number;
		public F:number;
		public block:number;//1 is block,0 is pass
		public constructor(pos:number[], id:number, block:number = 0, pid:number=0){
			let s = this;
			s.id = id;
			s.pid = pid;
			s.pos = pos;
			s.block = block;
			
			s.G = 0;
			s.H = 0;
			s.F = 0;
		}
		public clone():ANode
		{
			let s = this;
			return ANode.createANode([s.pos[0],s.pos[1]],s.id,s.block,s.pid);
		}
		public clear(): void
		{
			let s = this;
			if(s.inPool)return;
			PoolUtil.toPool(s, ANode);
		}
        public inPool: boolean;
        public outPoolInit(): void
		{
			let s = this;
			s.G = 0;
			s.H = 0;
			s.F = 0;
		}
        public dispose(): void
		{

		}		
		public static createANode(pos:number[], id:number, block:number = 0, pid:number=0):ANode
		{
			let aNode:ANode;
			aNode = <ANode>PoolUtil.fromPool(ANode);
			aNode.pos = pos;
			aNode.id = id;
			aNode.block = block;
			aNode.pid = pid;
			return aNode;
		}
	}
}